<?php

namespace app\common\model;

use think\Model;

class Students extends Model
{

    // 表名
    protected $name = 'students';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';

     /**
     * 关联班级表
     *
     * @return void
     */
    public function Classes()
    {
        return $this->belongsToMany('Classes', 'student_classes_relation', 'classes_id', 'student_id');
    }
}